$OpenBSD: patch-vpnc_c,v 1.4 2009/01/29 19:07:06 pea Exp $
--- vpnc.c.orig	Wed Nov 19 21:55:51 2008
+++ vpnc.c	Thu Jan 22 13:59:59 2009
@@ -190,10 +190,11 @@ static void addenv(const void *name, const char *value
 
 	oldval = getenv(name);
 	if (oldval != NULL) {
-		strbuf = xallocc(strlen(oldval) + 1 + strlen(value) + 1);
-		strcat(strbuf, oldval);
-		strcat(strbuf, " ");
-		strcat(strbuf, value);
+		size_t sz = strlen(oldval) + 1 + strlen(value) + 1;
+		strbuf = xallocc(sz);
+		strlcpy(strbuf, oldval, sz);
+		strlcat(strbuf, " ", sz);
+		strlcat(strbuf, value, sz);
 	}
 
 	setenv(name, strbuf ? strbuf : value, 1);
